package controllers

import (
	"github.com/beego/beego/v2/client/orm"
	beego "github.com/beego/beego/v2/server/web"
	"strconv"
	"year/models"
)

type UpController struct {
	beego.Controller
}

func (u *UpController) UpForm() {
	ids := u.GetString("id")
	id, _ := strconv.Atoi(ids)

	o := orm.NewOrm()
	d := models.Users{}
	o.QueryTable("users").Filter("id", id).One(&d)
	u.Data["date"] = d
	u.TplName = "up_form.html·"
}
